package com.imooc.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.imooc.beans.Message;
import com.imooc.service.MaintainService;
import com.imooc.service.MessageService;

public class DeleteOneServlet extends HttpServlet {
	
	
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		
		req.setCharacterEncoding("utf-8");
		
		String id=req.getParameter("id");
		
		MaintainService maintainService=new MaintainService();
		
		
		maintainService.deleteOne(id);		
		
	
		
		req.getRequestDispatcher("List.action").forward(req, resp);
		
	}
	
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

		
		
		this.doGet(req, resp);
	}
	
	

}
